package com.pig.graduate.controller.material;


import com.pig.graduate.domain.material.MaterialInventory;
import com.pig.graduate.result.MyResult;
import com.pig.graduate.service.material.MaterialInventoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"库存"}, description = "库存")
@RestController
@RequestMapping("/material/inventory")
public class MaterialInventoryController {


    @Autowired
    private MaterialInventoryService materialInventoryService;

    @ApiOperation(value = "库存列表",notes = "库存列表")
    @PostMapping("/list")
    public MyResult materialList(@RequestBody MaterialInventory materialInventory){
        return materialInventoryService.inventoryList(materialInventory);
    }

    @ApiOperation(value = "根据ID获取库存",notes = "根据ID获取库存")
    @GetMapping("/getOne")
    public MyResult getOne(@RequestParam String id){
        return materialInventoryService.getInventoryById(id);
    }






}
